﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace S.Services.SheepMale.Infrastructure.Migrations
{
    public partial class er1232111 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "SheepMarket");

            migrationBuilder.AddColumn<DateTime>(
                name: "BirthDay",
                table: "EntityMarket",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Birthweight",
                table: "EntityMarket",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<string>(
                name: "Breed",
                table: "EntityMarket",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "CottageName",
                table: "EntityMarket",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Earbugles",
                table: "EntityMarket",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "FatherEar",
                table: "EntityMarket",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "FieldName",
                table: "EntityMarket",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "FixPrice",
                table: "EntityMarket",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<string>(
                name: "Level",
                table: "EntityMarket",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MomtherEar",
                table: "EntityMarket",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "MonthAge",
                table: "EntityMarket",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "SheepSex",
                table: "EntityMarket",
                type: "bit",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "SheepTypeInfo",
                table: "EntityMarket",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Weaningweight",
                table: "EntityMarket",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "BirthDay",
                table: "EntityMarket");

            migrationBuilder.DropColumn(
                name: "Birthweight",
                table: "EntityMarket");

            migrationBuilder.DropColumn(
                name: "Breed",
                table: "EntityMarket");

            migrationBuilder.DropColumn(
                name: "CottageName",
                table: "EntityMarket");

            migrationBuilder.DropColumn(
                name: "Earbugles",
                table: "EntityMarket");

            migrationBuilder.DropColumn(
                name: "FatherEar",
                table: "EntityMarket");

            migrationBuilder.DropColumn(
                name: "FieldName",
                table: "EntityMarket");

            migrationBuilder.DropColumn(
                name: "FixPrice",
                table: "EntityMarket");

            migrationBuilder.DropColumn(
                name: "Level",
                table: "EntityMarket");

            migrationBuilder.DropColumn(
                name: "MomtherEar",
                table: "EntityMarket");

            migrationBuilder.DropColumn(
                name: "MonthAge",
                table: "EntityMarket");

            migrationBuilder.DropColumn(
                name: "SheepSex",
                table: "EntityMarket");

            migrationBuilder.DropColumn(
                name: "SheepTypeInfo",
                table: "EntityMarket");

            migrationBuilder.DropColumn(
                name: "Weaningweight",
                table: "EntityMarket");

            migrationBuilder.CreateTable(
                name: "SheepMarket",
                columns: table => new
                {
                    SheepMarkId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    AuditState = table.Column<bool>(type: "bit", nullable: false),
                    BirthDay = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Birthweight = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Breed = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Client = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CottageName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DepartmentId = table.Column<int>(type: "int", nullable: false),
                    DocumentNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Earbugles = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExamineBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ExamineDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    FatherEar = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FieldName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FinanceBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    FinanceDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    FixPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false),
                    Level = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarketAddress = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    MarketDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    MomtherEar = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MonthAge = table.Column<int>(type: "int", nullable: true),
                    PayPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Propagate = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SellPeople = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    SheepNumber = table.Column<int>(type: "int", nullable: false),
                    SheepSex = table.Column<bool>(type: "bit", nullable: true),
                    SheepTypeInfo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Stash = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StashBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    StashDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Weaningweight = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SheepMarket", x => x.SheepMarkId);
                });
        }
    }
}
